#include"IpAddressPort.h"
#include<sstream>
#include<iostream>



IpAddressPort::IpAddressPort(std::string ip,unsigned short port)
        :m_ip(ip),m_port(port)
{

}
std::string IpAddressPort::ToString()const
{
    std::stringstream ss;
    ss<<m_ip<<":"<<m_port;
    return ss.str();
}
void IpAddressPort::SetIpAddress(const std::string& ip)
{
    m_ip=ip;
}
std::string IpAddressPort::GetIpAddress()const
{
    return m_ip;
}

void IpAddressPort::SetPort(unsigned short port)
{
    m_port=port;
}
unsigned short IpAddressPort::GetPort()const{
    return m_port;
}




//测试代码
// int main()
// {
//     IpAddressPort t("127.0.0.1",3306);
//     std::cout<<t.ToString()<<std::endl;
//     return 0;
// }




